package com.sntk.organauthomanager.application.quartz;

import com.sntk.organauthomanager.application.service.InteriorRegistrationService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;

/**
 * @ClassName: HeartbeatDetectionJob
 * @author: wgchao
 * @createTime: 2020/9/7 5:28 PM
 * @Description: 服务心跳检测
 */
@Component
public class HeartbeatDetectionJob extends QuartzJobBean {
    @Autowired
    private InteriorRegistrationService interiorRegistrationService;

    private static final Logger logger = LoggerFactory.getLogger(HeartbeatDetectionJob.class);


    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        logger.info("-------服务心跳检测(开始)-------");

        interiorRegistrationService.heartbeatDetection();

        logger.info("-------服务心跳检测(结束)-------");
    }
}
